package net.neptech.model.schedule;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.neptech.utils.SnowflakeIdGenerator;
import org.hibernate.annotations.GenericGenerator;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @Author HuangZhengmin
 * @desc  请假表实体类
 * @Date 2025/8/12 17:18
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "sche_leave")
public class ScheLeave implements Serializable{
    @Serial
    private static final Long serialVersionUID = 1L;

  @Id
  @GenericGenerator(name = "snowflake", type = SnowflakeIdGenerator.class)
  @GeneratedValue(generator = "snowflake")
  @Column(name = "leave_id", nullable = false)
  private Long leaveId; // 请假ID

  @Column(name = "user_id")
  private Long userId; // 用户ID

  @Column(name = "leave_type")
  private Integer leaveType; // 请假类型(1-年假,2-病假,3-事假,4-产假,5-婚假)

  @Column(name = "start_date")
  private Date startDate; // 开始日期

  @Column(name = "end_date")
  private Date endDate; // 结束日期

  @Column(name = "days", precision = 10, scale = 1)
  private BigDecimal days; // 请假总天数

  @Column(name = "reason", length = 255)
  private String reason; // 请假原因

  @Column(name = "attachment", length = 255)
  private String attachment; // 证明文件附件路径

  @Column(name = "status", nullable = false)
  private Integer status = 0; // 状态(0-待审批,1-已批准,2-已拒绝)

  @Column(name = "approver_id")
  private Long approverId; // 审批人ID

  @Column(name = "approve_time")
  private Date approveTime; // 审批时间

  @Column(name = "approve_comment", length = 255)
  private String approveComment; // 审批意见

  @Column(name = "create_time")
  private Date createTime; // 创建时间

  @Column(name = "update_time")
  private Date updateTime; // 更新时间
}
